import request from '@/utils/request'
import type { GoodsType, GoodsListResult, GoodsListQuery } from './types'


/** 作品管理 */
class APIWorks {
    /** 我的作品 */
    static getGoodsList(params: GoodsListQuery, type: GoodsType) {
        return request<any, ResponseData<GoodsListResult[]>>({
            url: '/getGoodsList',
            method: 'POST',
            params,
            data: { type }
        })
    }

    /** 我的搬运 */
    static getTransports(params: GoodsListQuery, type: GoodsType) {
        return request<any, ResponseData>({
            url: '/getTransports',
            method: 'POST',
            params,
            data: { type }
        })
    }

    /** 获取基础订单详情 */
    static getBasicOrder(data: any) {
        return request<any, ResponseData>({
            url: '/getBasicOrder',
            method: 'POST',
            data
        })
    }

    /** 支付 */
    static setBccrOrder(data: any) {
        return request<any, ResponseData>({
            url: '/setBccrOrder',
            method: 'POST',
            data
        })
    }

    static getExposure() {
        return request<any, ResponseData>({
            url: '/getExposure',
            method: 'POST'
        })
    }

    static setExposure(data: any) {
        return request<any, ResponseData>({
            url: '/setExposure',
            method: 'POST',
            data
        })
    }

    static cancelTrans(data: any) {
        return request<any, ResponseData>({
            url: '/cancelTrans',
            method: 'POST',
            data
        })
    }

}

export default APIWorks
